Add installation behaviors to CMakeLists.txt #1317
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This isn't a PR you guys should necessarily merge, but just another datapoint on how to (potentially) handle installation packaging.
Background
Just for context, my use-case is that I'm experimenting with adding some sandboxed scripting to:
I really liked the vibe/design/portability of luau because I'm also in the middle of gradually porting the project's backend to wasm (WIP) and would eventually like users to be able to experiment with their own physics components etc. in a browser without a server-side backend and eventually provide a safe-to-distribute model format that includes scripted components.
Because I deploy to 3 (soon, 4) platforms, the way in which I handle dependencies is to provide a separate source-build of all of dependencies in
third_party
. The directory contains its ownCMakeLists.txt
, which usesExternalProject_Add
to build+install each dependency into a unified directory that can then be added to theCMAKE_PREFIX_PATH
of some downstream project (for me, it'sopensim-creator
). The idea is that some dependencies can be disabled, layered over the OS-provided ones, etc. without having to have customfind_package
steps inopensim-creator
(i.e. it can all be handled from the top-level build bash script or similar).Other PRs Like this
find_package
in a downstream project${CMAKE_INSTALL_LIBDIR}
etc.install
-related steps are closer to where the targets are configured, rather than being in a separate location, to minimize having to separately checkif(BUILDING_CLI)
-type flagsTesting I've Completed
I made these changes and now I can just
find_package
in my downstream branch. I'll report back once I have a branch building on all 4 (Win/MacOS/Linux/Emscripten) platforms.